package aaaAddr;

import java.util.ArrayList;
import java.util.List;

import org.apache.ftpserver.FtpServer;
import org.apache.ftpserver.FtpServerFactory;
import org.apache.ftpserver.ftplet.Authority;
import org.apache.ftpserver.ftplet.FtpException;
import org.apache.ftpserver.usermanager.impl.BaseUser;
import org.apache.ftpserver.usermanager.impl.WritePermission;
//aaaAddr.FtpServerTsest
public class FtpServerTsest {

	public static void main(String[] args) throws FtpException {
		
		  List<Authority> authorities = new ArrayList<Authority>();
		  authorities.add(new WritePermission());
		
		  
		  
		 BaseUser user = new BaseUser();
		  user.setName("anonymous");
		  user.setHomeDirectory("c:");
		  user.setAuthorities(authorities);
		  
	
		 FtpServerFactory serverFactory = new FtpServerFactory();
		  serverFactory.getUserManager().save(user);
		  FtpServer server = serverFactory.createServer();
		  server.start();
		  System.out.println("---f");
	}

}
